#!/bin/bash

# Call this script with paramenters, for example
# ./scriptname 1 2 3 4 5

echo 
echo "The name of this script is \"$0\"."
# got ./ scriptname
echo "The name of this script is \"`basename $0`\"."
# got basename

echo

if [ -n "$1" ]
then
    echo "Parameter #1 is $1"
fi

if [ -n "$2" ]
then
    echo "Parameter #1 is $2"
fi

echo "--------"
echo "All parameters are: "$*""

args=$# #number of args passed
echo $args
lastargs=${!args}
echo "last args is $lastargs"

exit 0
